<?php
class Application_PlotData
{
	protected $_series;
	protected $_axis;
	protected $_title;
	protected $_cartridge; 
	
	
	public function __construct($title) {
		$this->_title = $title;
	}
	
	public function addSerie($values = array(), $unit, $name, $label) {
		// 1
		/*
		$this->_series[] = array (
			'values' => $values, 
			'unit' => $unit, 
			'name' =>$name, 
			'label' => $label
		);
		*/
		// 2
		$serie = new stdClass();
		$serie->values = $values;
		$serie->unit = $unit;
		$serie->name = $name;
		$serie->label = $label;
		$this->_series[] = $serie;
	}
	
	public function setXAxis($values = array(), $unit, $name, $label) {
		$serie = new stdClass();
		$serie->values = $values;
		$serie->unit = $unit;
		$serie->name = $name;
		$serie->label = $label;
		$this->_axis[0] = $serie;
	}

	public function setYAxis($values = array(), $unit, $name, $label) {
		$serie = new stdClass();
		$serie->values = $values;
		$serie->unit = $unit;
		$serie->name = $name;
		$serie->label = $label;
		$this->_axis[1] = $serie;
	}
	
	public function getTitle() {
		return $this->_title;
	}
	
	/*
	public function getLegend() {
	}
	*/
	
	public function getSerie($n = 0){
		return $this->_series[$n];
	}
	
	public function getXAxis(){
		return $this->_axis[0];
	}

	public function getYAxis(){
		return $this->_axis[1];
	}
	
	public function useCartridge($cartridge) {
		$this->_cartridge = $cartridge;
	}

	public function getCartridge() {
		return $this->_cartridge;
	}
}